const { app, BrowserWindow, ipcMain } = require('electron')
// const WinState = require('electron-win-state').default //现在已经可以随便缩放了 。。
const path = require('path')


// 引入获取url的截图
// 获取网站的截图
require('./controller/getSource')
require('./controller/alertMsg')
require('./controller/openSite')

// console.log(WinState);
const createWindow = () => {

    // const winState = new WinState({
    //     defaultWidth: 1000,
    //     defaultHeight: 800,
    // })
    const win = new BrowserWindow({
        width: 800,
        height: 600,
        // ...winState.winOptions,
        webPreferences: {
            preload: path.join(__dirname, 'preload/index.js')
        }
    })

    // win.loadFile('http://localhost:5173')
    win.loadURL('http://localhost:5173')
    // win.webContents.openDevTools();
}

app.whenReady().then(() => {
    createWindow()
})